package cn.cxyxj.filters;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FilterTest {

    @GetMapping("/getHeader")
    public String getHeader(@RequestHeader("X-Request-name") String name){
        return "getHeader " + name;
    }

    @GetMapping("/getName")
    public String getName(@RequestParam("name") String name) {
        return "getName " + name;
    }

    @GetMapping("/get-custom-name")
    public String getCustomName(@RequestHeader("customName") String name){
        return "getCustomName " + name;
    }
}
